Repository navigation
GH-23686: SOAP: redact more headers by default, add keep_headers option - #23698
Conversation
|
@php/release-managers-86 can you please let me know if this needs to be in by the branch cut? I'm unsure if this counts as a new feature that would be blocked by the feature freeze - it adds more options, but the motivation is to allow opting out of the bug fix |
This comment was marked as resolved.
This comment was marked as resolved.
0b45594 to
0cfbf95
Compare
This comment was marked as resolved.
This comment was marked as resolved.
9d85384 to
c03aa23
Compare
|
@mbeccati and I agree this can go into 8.6 |
c03aa23 to
16464a7
Compare
|
This should be ready for review, ideally we should merge it in the next two weeks so that it is in RC3 |
16464a7 to
c25f6dd
Compare
c25f6dd to
ab9f64b
Compare
|
Okay
hopefully should be ready for another round of review |
|
If I'm reading the suggestions correctly, they are to handle headers that are stored as arrays properly - but the tests suggests that they are already handled? Looks like this is because $context = stream_context_create([
'http' => [
// having a protocol here means that SOAP won't add it itself
'protocol_version' => 1.1,
'header' => [
"X-Authorization: This should be kept",
"Authorization: This should be removed",
"X-Proxy-Authorization: This should also be kept",
"Proxy-Authorization: This should also be removed",
"X-Cookie: Last one to keep",
"Cookie: Last one to remove",
]
],
]);good catch - I hadn't addressed array headers originally since on #23686 I was told that they could be ignored, but you're right that we should probably address them, done |
ab9f64b to
b96d6d1
Compare
|
Regarding line separators: I was going based on CRLF, but RFC 9112 says (https://www.rfc-editor.org/info/rfc9112/#section-2.2)
so I'll go just by LF |
b96d6d1 to
6bf90e5
Compare
6bf90e5 to
68aa337
Compare
|
Rebased and added NEWS/UPGRADING, once CI passes I'll merge this locally so that commits stay signed |
|
Failure in FREEBSD is unrelated and pre-existing, merging |
|
Tests related to this PR fail on nightly CI: https://github.com/php/php-src/actions/runs/41260026425/job/124711397763 |
Hmm, and it isn't new, this seems to have been failing the which likely comes from the Coming from matrix.php Failing tests are:
I was able to reproduce this with |
|
Actually just Okay, minimized the configuration: Fail: Pass: |
|
Okay, so the error occurs the second time the SoapClient is constructed, and it doesn't matter which soap version is used for either the first or second construct, testing with SOAP_1_1 then SOAP_1_2, 1.2 then 1.1, 1.1 twice, and 1.2 twice, all fail The second time through, Line 154 in 3f06ea0 Unfortunately, I was unable to connect GDB with the libxml2 debug symbols, so I couldn't figure out why this is the case, and how ZEND_RC_DEBUG is at all related |
|
Okay, so if in GDB we For the first SoapClient constructor, the original URL and then the one to import E.g. At the start, before the first Hacking the and that presumably causes the server to stop This is actually unrelated to the SoapClient stuff, I was able to reproduce with by manually running and in another shell |
|
would the following solve the (main) issue ? diff --git a/sapi/cli/php_cli_server.c b/sapi/cli/php_cli_server.c
--- a/sapi/cli/php_cli_server.c
+++ b/sapi/cli/php_cli_server.c
@@ -1701,6 +1701,7 @@ static void php_cli_server_client_save_header(php_cli_server_client *client)
} else {
zend_string *curval = Z_STR_P(entry);
zend_string *newval = zend_string_safe_alloc(1, ZSTR_LEN(curval), ZSTR_LEN(client->current_header_value) + 2, /* persistent */true);
+ GC_MAKE_PERSISTENT_LOCAL(newval);
memcpy(ZSTR_VAL(newval), ZSTR_VAL(curval), ZSTR_LEN(curval));
memcpy(ZSTR_VAL(newval) + ZSTR_LEN(curval), ", ", 2); |
|
@devnexen I haven't tested that, but certainly that is an issue fix even if it doesn't fix the case found by Daniel, so please PR that 🙂 |
No description provided.